package com.example.demo.pojo.dto;

import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.ToString;
import org.apache.ibatis.annotations.Mapper;
import org.hibernate.validator.constraints.URL;

import java.util.List;

@Getter
@Mapper
@ToString
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class AddCommentDTO {
    @NotNull(message = "评论目标商品不能为空")
    private Long itemId;

    @NotBlank(message = "评论内容不能为空")
    private String content;

    @Size(max = 9)
    private List<@URL String> images; //图片url列表

    private Long parentId;

    private Long replyId;

    public AddCommentDTO() {
    }

    public AddCommentDTO(Long itemId, String content, List<@URL String> images, Long parentId, Long replyId) {
        this.itemId = itemId;
        this.content = content;
        this.images = images;
        this.parentId = parentId;
        this.replyId = replyId;
    }
}
